Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

549
Visualizações
Ruby2d not working in WSL2 on Ubuntu 18.04 - Getting error "No available video device"

I'm using WSL2 on Ubuntu 18.04 to run Ruby code in Windows 10. For example, running Ruby on Rails is easily done with no special setup required.

In case of Ruby2D: The installation went fine but, I get an error when running any Ruby2D file, even the most basic one:

require 'ruby2d'
show

I get this error in Console:

error: XDG_RUNTIME_DIR not set in the environment.
Error: (SDL_Init) No available video device
error: XDG_RUNTIME_DIR not set in the environment.
Error: (SDL_CreateWindow) No available video device
Error: (GL2 / SDL_GL_CreateContext) Video subsystem has not been initialized
Error: An OpenGL context could not be created

How do I "add" (or config) a "video device" to my Ubuntu on the WSL2?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

As you've noticed, WSL under Windows 10 doesn't have any GUI/X/windowing capabilities built in. There are a few possibilities:

  • If you have the ability to upgrade to Windows 11, it supports WSLg (built-in) for running Linux GUI apps directly on Windows. I did just install Ruby, ruby2d (and its dependencies) and was able to successfully execute your example. I assume it is just supposed to show a blank GUI window ...

If you can't upgrade to Windows 11, there are still several possible alternatives for running Linux GUI apps. I have not had a chance to test ruby2d in this type of environment, but I believe it should work. If you run into issues, I can at least get the first option up and running to try it out and see if we can work through it:

  • First, my preference is to install xrdp and a simple window manager like xfce. See my answer here for details and instructions. You don't need the full Gnome environment (which requires Systemd) - A simple installation of Xfce should do.

  • However, the most popular method is to install a third-party X server on Windows 10 and set up the DISPLAY variable manually. If you'd like to go this route, see this question and its answer for details.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda